import axios from "axios";
const request = axios.create({
  baseURL: "http://localhost:3000",
});
// 登陆
export const loginIN = (username, password) =>
  request.get(`/login?username=${username}&password=${password}`);
// 注册账号 data是一个对象 包含{username:'',password:''}
export const registerUser = (data) => request.post("/register", data);
// 商品列表
export const getShopList = () => request.get("/shop");
// 商品详情
export const getShopDetail = (id) => request.get(`/detail?id=${id}`);
//购物车
export const getCart = (id) => request.get(`/cart?id=${id}`);
